]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
shell: Restore NOFILE limit before restarting
authorOlivier Fourdan <ofourdan@redhat.com>
Wed, 19 Jan 2022 09:18:06 +0000 (10:18 +0100)
committerOlivier Fourdan <ofourdan@redhat.com>
Tue, 8 Feb 2022 08:25:25 +0000 (08:25 +0000)
When restarting Shell, make sure to restore the original nofile limit so
that the new instance starts with the original value.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2117>

src/shell-global.c

index a603ab3840a86ab52ee15895d7dbf681a4bc9b21..ac8edb1e5b716e41de5293d94a01d5f4c4d04d60 100644 (file)
@@ -1166,6 +1166,7 @@ shell_global_reexec_self (ShellGlobal *global)
 {
   GPtrArray *arr;
   gsize len;
+  MetaContext *meta_context;
 
 #if defined __linux__ || defined __sun
   char *buf;
@@ -1242,6 +1243,9 @@ shell_global_reexec_self (ShellGlobal *global)
    */
   pre_exec_close_fds ();
 
+  g_object_get (global, "context", &meta_context, NULL);
+  meta_context_restore_rlimit_nofile (meta_context, NULL);
+
   meta_display_close (shell_global_get_display (global),
                       shell_global_get_current_time (global));